<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        console.log(a);// undefined
        var a = 10;
        console.log(a); // a=10


        foo();
        function foo() {
            console.log('Hello');//hello
        }



        function func() {
            var b = 20;
            fn1();
            function fn1() {
                console.log(b);//b=20
            }
        }
        func();



        function fn2() {
            var count = 100;
        }
        fn2();



        function fn3(num) {
            console.log(num); // 200
            var num = 150;
            console.log(num);// 150
        }
        fn3(200);



        function fn4(k) {
            console.log(k); // 250
            var k;
            console.log(k);// 250
        }
        fn4(250)




        function fn5(fo1) {
            console.log(fo1);//函数
            function fo1() {
                console.log('函数fo1');
            }
            console.log(fo1);//函数
        }
        fn5(300);


    </script>
</body>

</html>